import { TaskDto } from './task.dto';
import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty, IsNumber } from 'class-validator';


export class CreateTaskDto extends TaskDto {
  @ApiProperty({ required: true, description: '任务名' })
  @IsString({ message: '任务名必须为字符类型' })
  @IsNotEmpty({ message: '任务名不能为空' })
  readonly name: string;

  @ApiProperty({ required: true, description: '任务组' })
  @IsNumber()
  @IsNotEmpty({ message: '任务组不能为空' })
  readonly group: number;

  @ApiProperty({ required: true, description: '定时任务规则' })
  @IsNotEmpty({ message: '定时任务规则不能为空' })
  readonly rules: string | number;
}